<template>
  <div>
    <div v-show="!readonly" class='com-editor' id="product-edit">
    </div>
    <div v-if="readonly" class='com-editor ft14'>这里是需要直接显示的内容</div>
    </div>
</template>
<script>
export default {
  props:['readonly'],
  components: {},
  name: "",
  data() {
    return {};
  },
  methods: {
    init(){
      var E = window.wangEditor
      var editor = new E('#product-edit')
      editor.customConfig.uploadImgServer = picPATH //配置服务地址
      editor.create()
      editor.txt.html(this.$store.state.editors.product.content)
    }
  },
  created() {
    this.$nextTick(()=>{
      this.init()
    })
  }
};
</script>
<style lang="scss" scoped>
.com-editor {
  margin-top: 10px;
  margin-left: 20px;
}
</style>